<?php echo $this->view->menssagem; ?>
<div class="panel panel-default">
    <div class="panel-heading" style="text-align: center;font-weight:  bold;">RELATÓRIO DE CONTAS A PAGAR VENCIDAS</div>
</div>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>Documento</th>
            <th>Beneficiario</th>
            <th>Descrição</th>
            <th>Vencimento</th>
            <th style="text-align: right;">Valor</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $total = 0;
        if (isset($this->view->lista)) {

            foreach ($this->view->lista as $c) {
                echo '<tr>';
                echo '<td>';
                echo $c['numero_documento'];
                echo '</td>';
                echo '<td>';
                echo $c['beneficiario_nome'];
                echo '</td>';
                echo '<td>';
                echo $c['descricao'];
                echo '</td>';
                echo '<td>';
                echo SON\UTIL\Converter::dataParaString($c['vencimento']);
                echo '</td>';
                echo '<td align="right">';
                echo 'R$ ' . SON\UTIL\Converter::doubleParaString($c['valor']);
                echo '</td>';
                echo '</tr>';
                $total = $total + $c['valor'];
            }
        }
        ?>
        <tr>
            <th>TOTAL</th>
            <th></th>
            <th></th>
            <th></th>
            <th style="text-align: right;"><?php echo 'R$ ' . \SON\UTIL\Converter::doubleParaString($total); ?></th>
        </tr>
    </tbody>
</table>

